def fall(inntak):
	if inntak == 1:
		return 0
	if inntak == 2:
		return 1
	if inntak == 3:
		return 2
	else:
		return (fall(inntak-1)+(inntak-1)//2)*(inntak-1)

profanir = int(input())

tilvik = []
for x in range(profanir):
	tala = int(input())
	tilvik.append(tala)
	print(fall(tala))
	
